<?php

if($_POST){
	require_once('../config.php');

	$user = $_POST['user'];
	$password = md5($_POST['password']);


	$res = $con->query("select password from ad_user where(user='".$user."')");

	 $data = mysqli_fetch_assoc($res);


	 if($data['password']==$password){

	 	session_start();
	 	// setSessionTime(3600);
	 	$_SESSION['user']=$user;
		header("Location:index.php");
	 }else{
	 	
	 	header("Location:login.html");
	 }


}else{

	header("Location:login.html");
}



?>